<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="inc/taglibs.jsp" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <%@ include file="inc/meta.jsp" %>
    <meta name="description" content="">
    <meta name="author" content="">
    <title>财务收入列表</title>
    <%@ include file="inc/css.jsp" %>
</head>

<body>
<div id="posts" class="wrapper">

    <%@ include file="inc/nav.jsp" %>

    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">财务收入列表</h1>
            </div>
            <!-- /.col-lg-12 -->
        </div>

        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading" style="height: 70px;">
                        <form class="navbar-form navbar-right" role="search">
                            <div class="form-group">
                                <input type="text" class="form-control" id="companyUserGainId" maxlength="20" placeholder="编号"/>
                            </div>
                            <div class="form-group">
                                <input type="text" class="form-control" id="mobile" maxlength="20" placeholder="交易用户"/>
                            </div>
                            <div class="form-group">
                                <label>交易类型：</label>
                                <select id="typeList" style="width: 120px;" class="form-control">
                                    <option value="">全部</option>
                                    <option value="1">支付宝</option>
                                    <option value="2">银联</option>
                                </select>
                            </div>
                            <button type="button" id="c_search" class="btn btn-primary btn-sm">搜索</button>
                        </form>
                    </div>
                    <!-- /.panel-heading -->
                    <div class="panel-body">

                        <div class="table-responsive">

                            <table class="table table-striped table-bordered table-hover" id="dataTables">
                                <colgroup>
                                    <col class="gradeA odd"/>
                                    <col class="gradeA even"/>
                                    <col class="gradeA odd"/>
                                    <col class="gradeA even"/>
                                    <col class="gradeA odd"/>
                                </colgroup>
                                <thead>
                                <tr>
                                    <th>编号</th>
                                    <th>交易类型</th>
                                    <th>交易时间</th>
                                    <th>交易用户</th>
                                </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>

                    </div>
                    <!-- /.panel-body -->

                </div>
                <!-- /.panel -->
            </div>
        </div>
    </div>
    <!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->

<%@ include file="inc/footer.jsp" %>
</body>

<script type="text/javascript">
    var _financeList = {
        v: {
            id: "_financeList"
        },
        fn: {
            init: function () {
                _financeList.fn.dataTableInit();

                // 查询
                $("#c_search").click(function () {
                    _financeList.v.dTable.ajax.reload();
                });
            },
            dataTableInit: function () {
                _financeList.v.dTable = $leoman.dataTable($('#dataTables'), {
                    "processing": true,
                    "serverSide": true,
                    "searching": false,
                    "ordering": false,
                    "ajax": {
                        "url": "backend/finance/list",
                        "type": "POST"
                    },
                    "columns": [
                        {"data": "id"},
                        {
                            "data": "type",
                            render: function (data) {
                                var showName = "";
                                switch (Number(data)) {
                                    case 1:
                                        showName = "支付宝";
                                        break;
                                    case 2:
                                        showName = "银联";
                                        break;
                                }
                                return showName;
                            }
                        },
                        {
                            "data": "createTime",
                            render: function (data) {
                                return formatJsonDateTime(data, 'yyyy-MM-dd hh:mm:ss');
                            }
                        },
                        {"data": "companyUser.mobile"}
                    ],
                    "fnServerParams": function (aoData) {
                        aoData.companyUserGainId = $('#companyUserGainId').val();
                        aoData.mobile = $('#mobile').val();
                        aoData.type = $('#typeList option:selected').val();
                    },
                    "fnDrawCallback": function (row) {
                        $leoman.uiform();
                    }
                });
            }
        }
    }

    $(document).ready(function () {
        _financeList.fn.init();
    });

</script>

</html>